<template>
  <div class="companyInfo">
    <a @click="actionCb(scope)">{{ scope.scope.email }}</a>
    <div class="companyInfo-type" v-if="userType">
      <div>
        <span>用户名：{{ scope.scope.userName }}</span>
        <span>手机：{{ scope.scope.phonenumber }}</span>
        <span>QQ：{{ scope.scope.qq }}</span>
      </div>
    </div>
    <div class="companyInfo-type" v-else>
      <div>
        <span>企业名称：{{ scope.scope.enpName }}</span>
        <span>联系人：{{ scope.scope.enpContact }}</span>
        <span>手机：{{ scope.scope.enpPhone }}</span>
      </div>
      <span>统一社会信用代码：{{ scope.scope.enpNo }}</span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    instance: Object,
    scope: Object // text, index, scope
  },
  data() {
    return {
    }
  },
  computed: {
    userType() { //企业用户显示企业字段，用户显示用户
      const { userType } = this.scope.scope
      if (userType === '01' || userType === '00') { //用户
        return true
      } else {
        return false
      }
    }
  },
  methods: {
    actionCb(row) {
      const { cb } = this.instance
      this.$emit('actionClick', { row, cb })
    }
  }
}
</script>
